<!-- 查询 content 列表 -->
{{ $selectList := selectList "content" .q .pageNo 20  "* FROM content WHERE status in (1,2) and tag=? order by status desc,sortNo desc" .UrlPathParam }}

{{ $site:=site }}
<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <title>{{.UrlPathParam}}</title>
  <meta name="description" content="{{ $site.Description }}" />
  <meta name="keyword" content="{{ $site.Keyword }}" />

{{template "bodystart.html"  }}

<section id="archive" class="archive">
  <div class="archive-title category">
        <h2 class="archive-name">{{.UrlPathParam}}</h2>
  </div>
  {{ range $k,$v := $selectList.Data }}
  <div class="archive-post">
      <span class="archive-post-time">
        {{ slice .UpdateTime 0 10 }} 
      </span>
      <span class="archive-post-title">
        <a href="{{basePath}}{{ trimSlash $v.Id }}" class="archive-post-link">
          {{ .Title }}
        </a>
      </span>
  </div>
  {{end}}
    
    
</section>
  
<nav class="pagination">
  {{$currPageNo := $selectList.Page.PageNo}}
  {{if lt $currPageNo 1}}
    {{$currPageNo = 1}}
  {{end}}
  {{if gt $currPageNo $selectList.Page.PageCount }}
     {{$currPageNo = $selectList.Page.PageCount}}
  {{end}}

  {{if gt $currPageNo 1}}
  <a class="prev" href="{{basePath}}tag/{{.UrlPathParam}}/page/{{ addInt $currPageNo -1 }}?q={{.q}}">
      <i class="iconfont icon-left"></i>
      <span class="prev-text">上一页</span>
    </a>
  {{end}}
  {{if lt $currPageNo $selectList.Page.PageCount}}
  <a class="next" href="{{basePath}}tag/{{.UrlPathParam}}/page/{{ addInt $currPageNo 1 }}?q={{.q}}">
      <span class="next-text">下一页</span>
      <i class="iconfont icon-right"></i>
    </a>
    {{end}}   
</nav>
        

  {{template "bodyend.html" }}